package com.netease.rmi.server;

import java.rmi.Naming;

/**
 * @author bjweitingting
 * @description
 * @date 2018/8/22
 **/
public class Main {
    public static void main(String[] args) {
        UserHandlerInterface userHandler = null;
        try {
            userHandler = new UserHandlerImpl();
            System.out.println("server_userHandler=" + userHandler.hashCode());
            Naming.rebind("rmi://127.0.0.1:1099/user", userHandler);
            UserHandlerInterface userHandlerInterface = new UserHandlerImpl();
            System.out.println("server_userHandlerInterface=" + userHandlerInterface.hashCode());
            Naming.rebind("user", userHandlerInterface);
            System.out.println(" rmi server is ready ...");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
